package com.iflytek.utils;

import org.springframework.core.convert.converter.Converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateConverter1 implements Converter<String, Date> {
    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM‐dd HH:mm:s s");


    @Override
    public Date convert(String dateStr) {
        System.out.println("进入了此类型转换器1：yyyy/MM‐dd HH:mm:ss");
        try {
            return sdf.parse(dateStr);
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
    //字符串‐‐‐‐>日期

}
